package AI.screens
{
	import com.cheezeworld.AI.AISettings;
	import com.cheezeworld.AI.Behaviors.*;
	import com.cheezeworld.entity.*;
	import com.cheezeworld.screens.IScreenItem;
	import com.cheezeworld.utils.Input;

	public class ProjectedDemo extends AIDemoScreen
	{
		public function ProjectedDemo(a_parentScreen:IScreenItem=null)
		{
			super(a_parentScreen);
			
			screenLabel = "Projected Arrive and Seek";
			
			// Create some boids
			var boid1:Boid;
			var boid2:Boid;
			var boid3:Boid;
			var boid4:Boid;
			boid1 = _factory.getEntity( "Boid1", _gameworld ) as Boid;
			boid2 = _factory.getEntity( "Boid1", _gameworld ) as Boid;
			boid3 = _factory.getEntity( "Boid1", _gameworld ) as Boid;
			boid4 = _factory.getEntity( "Boid1", _gameworld ) as Boid;
			
			boid1.newPos.Set( 250, 250 );
			boid1.steering.addBehavior( new ProjectedArrive( Input.instance.worldMousePos, 50, AISettings.arriveFast ) );
			
			boid2.steering.addBehavior( new ProjectedArrive( boid1.actualPos, 50, AISettings.arriveFast ) );
			boid3.steering.addBehavior( new ProjectedArrive( boid2.actualPos, 50, AISettings.arriveFast ) );
			boid4.steering.addBehavior( new ProjectedSeek( boid3.actualPos, 50 ) );
		}	
		
	}
}